*** Create Figure 3: Polarization by authoritarian beliefs, conspiratorial predisposition and political sophistication

	*** In section 1 of this syntax, the margins plotted in Figure 3 are estimated.
	*** These margins are exported manually to create a .csv data file, which is available for download in the reproduction package
	*** Section 2 of this syntax creates Figure 3 from the .csv file

****************************************************************************************************************************
*** Section 1
****************************************************************************************************************************

use  data_long.dta, clear

local controls1 "age female educ_secondary educ_prof_high educ_acad_high i.exp"

sum know_sum, det
mixed poolexp i.treat_exp##c.know_sum `controls1' conspiracy_sum authoritarian pred_bundes_gov_r pred_Russia_r  || lfdn:
margins, at(know_sum=(0) treat_exp=(1 2 4))			// vulnerable group, No frame, Russian and Western frame
margins, at(know_sum=(.875) treat_exp=(1 2 4))		// mainstream, No frame, Russian and Western frame

sum conspiracy_sum, det
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' know_sum authoritarian pred_bundes_gov_r pred_Russia_r || lfdn:
margins, at(conspiracy_sum=(.75) treat_exp=(1 2 4))			// vulnerable group, No frame, Russian and Western frame
margins, at(conspiracy_sum=(.0625) treat_exp=(1 2 4))		// mainstream, No frame, Russian and Western frame

sum authoritarian, det
mixed poolexp i.treat_exp##c.authoritarian `controls1' know_sum conspiracy_sum pred_bundes_gov_r pred_Russia_r || lfdn:
margins, at(authoritarian=(.83) treat_exp=(1 2 4))			// vulnerable group, No frame, Russian and Western frame
margins, at(authoritarian=(.29) treat_exp=(1 2 4))		// mainstream, No frame, Russian and Western frame



****************************************************************************************************************************
*** Section 2
****************************************************************************************************************************

drop _all

import delimited using data_Fig3.csv, delim(comma)

graph set window fontface "Times New Roman"

twoway rcapsym lbound ubound n1, scheme(s1mono) aspectratio(.7) horizontal xscale(range(2.5 3.3)) xlabel(2.5(.1)3.3) ylabel(1.25 "Low" 1.75 "High" 2.25 "By political knowledge" 3.25 "Strong" 3.75 "Weak" 4.25 "By belief in conspiracy theory" 5.25 "Strong" 5.75 "Weak" 6.25 "By authoritarian beliefs", nogrid  angle(horizontal)) yscale(lcolor(white)) ytitle("") msymbol(none) graphregion(color(white)) title("   Control vs. Anti-mainstream vs. Mainstream frame   ", box size(med)) xtitle("") || scatter n1 control,  msymbol(circle) mfcolor(white) mcolor(black) msize(large)  ||  scatter n1 lbound,  msymbol(d) mfcolor(white) mcolor(black) msize(large) ||  scatter n1 ubound,  msymbol(d) mcolor(black) msize(large) legend(off) saving(polarization, replace)

graph export Fig3.pdf, replace

